armv7: psci: cpu_off: flush D-Cache before disable D-Cache
Before disable cache, need to first flush cache.
There maybe dirty data in D-Cache before disable D-Cache.
After disable D-Cache, the first store instructions in
psci_v7_flush_dcache_all will directly store registers
{r4-r5, r7, r9-r11, lr} to memory.
If there is dirty data before disable D-Cache,
psci_v7_flush_dcache_all will flush data to memory,
and may overwrite the memory that hold the registers
{r4-r5, r7, r9-r11, lr}.
So before disable cache, first flush D-Cache.
Signed-off-by: Peng Fan <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Hongbo Zhang <[email protected]>
Cc: York Sun <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Tom Rini <[email protected]>